from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_core.runnables import RunnableSequence
from model_utils import getLLM

llm = getLLM()

template = ChatPromptTemplate([
    ("system","你是一名优秀的翻译官，将用户的信息翻译成{language}"),
    ("human","{content}")
])

parser = StrOutputParser()
chain_sequence = RunnableSequence(template,llm,parser)
msg_list = [{"language":"英语","content":"我爱你"},{"language":"日语","content":"我爱你"}]
r = chain_sequence.batch(msg_list)
print(r)